import Vue from "vue";

import "normalize.css/normalize.css"; // A modern alternative to CSS resets

import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";

import "./styles/index.scss"; // global css

import App from "./App.vue";
import router from "./router";
import fetchSmart from "@/utils/fetch";
import validForm from "@/utils/validForm.js";
import formatTime from "@/utils/formatTime.js";

import uploadVideo from "@/components/uploadVideo";
import uploadPicture from "@/components/uploadPicture";
import uploadFiles from "@/components/uploadFiles";

Vue.component("uploadVideo", uploadVideo);
Vue.component("uploadPicture", uploadPicture);
Vue.component("uploadFiles", uploadFiles);

import "@/icons";
Vue.prototype.$fetch = fetchSmart;
Vue.use(ElementUI);
Vue.use(formatTime);
Vue.use(validForm);

Vue.config.errorHandler = function errorHandler(err, vm, info) {
  console.error("Global Error:", err, vm, info);
};


window.vueInstance = new Vue({
  el: "#app",
  router,
  render: (h) => h(App),
});

fetchSmart.post('/api/user/check-status', {});
